Welcome to HTML5 Browser Support. After watching this video, you will be able to explain how browsers support HTML5 features, list which browsers support which HTML5 features, and define browser support table. Not all browsers fully support all the features that are described in
the HTML5 and CSS3 specifications. For example, older versions of browsers
do not support certain features. The developers of different browsers
are continually adding support for HTML5 features to their new browser versions. For the most comprehensive support of HTML5
features, consider using Google Chrome. Support tables show which features
are supported by which browsers and can be a useful tool when developing web pages. For example, caniuse.com has great
support tables for HTML5, CSS3, etc. Here are the results of displaying the input
type=‘date’ element in different browsers. The Google Chrome browser displays
a calendar to enter the data. The Microsoft Edge browser displays
spinning boxes to enter the data. Notice the difference in date
formats (yyyy-mm-dd vs mm/dd/yyyy). The Firefox browser displays
the date field as a text field. This could raise several issues
regarding input format and validation. This example shows a support table
for the input type=‘date’ element. The numbers represent the browser version.
The color determines the level of support. Green: Full support. Olive: Partial support. Red: No support. Edge, Chrome, and Opera browsers are green, meaning they support the
input type=‘date’ element. Internet Explorer and Safari browsers are red, meaning they do not support
the input type=‘date’ element. Support levels change as developers
of browsers add new features, so check back frequently to see if the
features you require are supported. You can also use JavaScript to check whether a
certain HTML5 element is supported by a browser. First, create a DOM element by typing
document.createElement() and include the element type as a parameter argument. As a result, the DOM object gets created. If the browser does not support that
element, the DOM object that gets created has a set of common properties,
but nothing specific for that element. You then test for a known property or
method on the DOM object that you created. If that property or method does not
exist, then the browser does not yet fully support the DOM element (or
the HTML5 tag) that has been created. Browsers that do not support the
element can revert to a fallback or default behavior such as displaying
the field as a regular text field. Here is an example of using
JavaScript to check whether a certain HTML5 element is supported by a browser. This code is used to test whether the browser
supports the element input type=‘date’ / In the example, you dynamically create
the DOM object for the input element, and then you set the type
attribute to the value of "date.“ If the browser does not
support the input type=date, the field is displayed in the
browser as a regular text field. In this video, you learned not all browsers fully support all the features that are described in
the HTML5 and CSS3 specifications, caniuse.com has good support tables that show
what features are supported by which browsers, and you can use JavaScript to check whether a
certain HTML5 element is supported by a browser.